<%@include file="_header.jsp"%>
<%@include file="_menu.jsp"%>
<%@include file="_include.jsp"%>

<article id="article">

<h3 style="align: center;">Bienvenido Alumno(a): ${user.name }
	${user.lastname }</h3>

	<table>
		
		<br/>
		<br/>

		<table class="general-table">
			<thead>
				<tr>
					<th>Curso</th>
					<th>Semestre</th>
					<th>Tipo Curso</th>
					<th>Asistencia</th>
					<th>Historial</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${ lstEnrollments}" var="enr" varStatus="i">
					<c:choose>
						<c:when test="${(i.index)%2 == 0 }">
							<tr class="odd">
						</c:when>
						<c:otherwise>
							<tr>
						</c:otherwise>
					</c:choose>
						<td>${enr.myCourse.name }</td>
						<td>${enr.mySemester.description }</td>
						<td>${enr.myCourse.myTypeCourse.description }</td>
						<td>
							<c:set var="ok" value="0" scope="page"/>
							<c:set var="late" value="0" scope="page"/>
							<c:set var="miss" value="0" scope="page"/>
							
							<c:forEach items="${enr.myAssistance }" var="assist">
								<c:choose>
									<c:when test="${assist.action == 'OK' }">
										<c:set var="ok" value="${ok+1 }"/>
									</c:when>
									<c:when test="${assist.action == 'LATE' }">
										<c:set var="late" value="${late+1 }"/>
									</c:when>
									<c:otherwise>
										<c:set var="miss" value="${miss+1 }"/>
									</c:otherwise>
								</c:choose>
							</c:forEach>
							
							${ok }-Asistencias / ${miss }-Faltas /${late }-Tardanzas
							
						</td>
						<td>
							<a href="record-asistencia.tecsup?im=${enr.idEnrollment}&ic=${enr.myCourse.idCourse}">Ver</a>
						</td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
		
	</table>
	<br/><br/>
</article>

<%@include file="_footer.jsp"%>